import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;

/**
 * @author vivi
 * @description
 * @date 2024/5/10
 */
public class demo2 {
    public static void main(String[] args)
    {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();

        HashSet<String> set = new HashSet<>();

        while(n-- != 0)
        {
            char[] s = in.next().toCharArray();
            Arrays.sort(s);
            set.add(new String(s));
        }

        System.out.println(set.size());
    }

}
